package cn.xorange.commons.core.basic.bean;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author : yangjian
 * @date : 2023/10/7
 */
@Data
public class LogApi {

    private String name;
    private String url;
    private String method;
    private String isTest;
    private String owner;
    private Serializable param;
    private Serializable result;
    // 请求时间
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date requestTime;
    // 响应时间
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date responseTime;
    private Integer useTime;

    public String getIsTest(){
        if(Objects.nonNull(this.isTest) && this.isTest.equals("1")){
            return "测试";
        }else {
            return "生产";
        }
    }
}
